public class Triangle {
public float firstEdge;
public float  secondEdge;
public float thirdEdge;
     public void  squaring()
        {
            float p=(firstEdge+secondEdge+thirdEdge)/2;
        float s;//S=√[p(p-a)(p-b)(p-c)]
        s=(float) Math.sqrt(p*(p-firstEdge)*(p-secondEdge)*(p-thirdEdge));
        System.out.println("三角形面积为："+s);
         }

    public static void main(String[] args) {
        Triangle t=new Triangle();
        t.firstEdge = 30 ;
        t.secondEdge = 40 ;
        t.thirdEdge = 50 ;
        t.squaring() ; // 计算面积并在控制台输出面积
    }
}
